//入口文件地址

//es6写法
//加载vue
import Vue from "vue";
//加载vue路由
import VueRouter from "vue-router";

import App from "./app.vue";

//加载五个页面
import Home from "./pages/home/home.vue";
import Member from "./pages/member/member.vue";
import Class from "./pages/class/class.vue";
import Shop from "./pages/shop/shop.vue";
import My from "./pages/my/my.vue";

//使用路由
Vue.use(VueRouter);

const router = new VueRouter({
    //去掉网址的#号(然并卵)
    // mode:"history",
    routes:[
        // 直接设置主页   path:"/",为默认主页
        {path:"/",component:Home},
        {path:"/member",component:Member},
        {path:"/class",component:Class},
        {path:"/shop",component:Shop},
        {path:"/my",component:My},
    ]
})

//跳到指定的默认页面
// router.push("class");

new Vue({
    router,
    render:h=>h(App)
}).$mount("#app");